package com.qfedu.scode.service.impl;

import com.qfedu.scode.entity.Userlog;
import com.qfedu.scode.dao.UserlogDao;
import com.qfedu.scode.service.intf.UserlogService;
import com.qfedu.scode.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: StartCoding
 * @description: 一款真正的后端源码生成器，助力轻松入门Java程序
 * @author: Feri(老邢)
 * @create: 2021-01-06 11:09:45
 */
@Service
public class UserlogServiceImpl implements UserlogService{
    /*
    *注入持久层对象*/
    @Autowired
    private UserlogDao dao;
    /*
    * 新增内容*/
    @Override
    public R save(Userlog userlog) {
        if(userlog!=null){
            if(dao.insert(userlog)>0){
                return R.ok();
            }
        }
        return R.fail("新增异常");
    }
    /*
    * 查询 所有数据*/
    @Override
    public R queryAll() {
        return R.ok(dao.selectAll());
    }
}